package com.jeeplus.modules.fee.service;

import com.jeeplus.core.service.BaseService;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

///**
// * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
// */
//package com.jeeplus.modules.fee.service;
//
//
//import com.alibaba.fastjson.JSONObject;
//import com.jeeplus.core.service.BaseService;
//import com.jeeplus.modules.flow.service.ActionService;
//import com.jeeplus.modules.sys.mapper.UserMapper;
//import com.jeeplus.modules.sys.utils.UserUtils;
//import com.jeeplus.modules.wms.service.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//
//import javax.annotation.Resource;
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//import java.util.UUID;
//
///**
// * 执行器Service
// * 动作操作需要执行的方法，都在此service中定义
// *
// * @author sixp
// * @version 2017-7-16
// */
@Service

public class ExecuteService extends BaseService {}
//
//    @Autowired
//    private UserMapper userDao;
//    @Autowired
//    private ActionService actionScheduleService;
//
//    @Resource
//    private JdbcTemplate jdbc;
//
//    /**
//     *校验动作
//     *
//     * @param parms
//     * @return
//     */
//    @Transactional(readOnly = false)
//    public boolean check(String parms,String type){
//        //库存检验
//     if(type.equals("checkstore")){
//        return checkstore(parms);
//
//     }
//
//        return false;
//    }
//    @Transactional(readOnly = false)
//    private boolean checkstore(String parms) {
//        JSONObject obj= JSONObject.parseObject(parms);
//        String code=obj.get("code")+"";
//        String locationCode=(obj.get("code")+"");
//        String amount=obj.get("amount")+"";
//        OutStock outStock=outStockService.findUniqueByProperty("outStockCode",code);
//        outStock=outStockService.get(outStock.getId());
//        Stock stock=new Stock();
//        stock.setLocationCode(locationCode);
//        stock.setStoreId(outStock.getStoreID().getId());
//        List<Stock> list=stockService.findList(stock);
//        if(list==null||list.size()<1){
//            return false;
//        }
//        stock=list.get(0);
//        Double d=stock.getQuantity();
//        if(d>=Integer.parseInt(amount)){
//            return  true;
//        }
//        return  false;
//    }
//
//
//    @Transactional(readOnly = false)
//public void execute(String parms,String type){
//    if(type.equals("addOrUpdateStock")){
//        addOrUpdateStock(parms);
//    }else if(type.equals("addInStockRecord")) {
//        addInStockRecord(parms);
//    }else if(type.equals("updateInStockStatus")){
//        updateInStockStatus(parms);
//    }else if(type.equals("updateInStockSkuNumber")){
//        updateInStockSkuNumber(parms);
//    }else if(type.equals("updateInStockBeforeStatus")){
//        updateInStockBeforeStatus(parms);
//    } else if(type.equals("updateOutStockStatus")){
//        updateOutStockStatus(parms);
//   }else if(type.equals("updateOutStockSkuNumber")){
//        updateOutStockSkuNumber(parms);
//    }else if(type.equals("addOutStockRecord")){
//        addOutStockRecord(parms);
//    }else if(type.equals("addRouting")){
//        addRouting(parms);
//    }else if(type.equals("updateOrderStatus")){
//        updateOrderStatus(parms);
//    }else if(type.equals("updateStatus")){
//        updateStatus(parms);
//    } else if(type.equals("addInStockRecordBC")){
//        addInStockRecordBC(parms);
//    }else if(type.equals("addOrUpdateStockBC")){
//        addOrUpdateStockBC(parms);
//    }
//
//
//
//}
//
////    @Transactional(readOnly = false)
////public void reflect(String parms,String type) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
////    Class<?> cls = Class.forName("com.jeeplus.modules.fee.service.ExecuteService");
////    Object obj = cls.newInstance();
////    Method m=cls.getMethod(type,String.class);
////    m.invoke(obj,parms);
////}
//
//    //更改采购单状态
//    @Transactional(readOnly = false)
//    public void updatePurchaseStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String status=obj.get("status")+"";
//        Purchase purchase=purchaseService.findUniqueByProperty("code",code);
//       purchase.setStatus(status);
//        purchaseService.save(purchase);
//    }
//    //更改调拨单状态
//    @Transactional(readOnly = false)
//    public void updateRequisitionStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String status=obj.get("status")+"";
//        Requisition requisition=requisitionService.findUniqueByProperty("code",code);
//        requisition.setStatus(status);
//        requisitionService.save(requisition);
//    }
//    //更改退货单状态
//    @Transactional(readOnly = false)
//    public void updateReturnStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String status=obj.get("status")+"";
//        ReturnGoods returnGoods=returnService.findUniqueByProperty("code",code);
//        returnGoods.setStatus(status);
//        returnService.save(returnGoods);
//    }
//
//    //更改入库单状态
//    @Transactional(readOnly = false)
//    public void updateInStockStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String status=obj.get("status")+"";
//        InStock inStock=inStockService.findUniqueByProperty("code",code);
//        inStock=inStockService.get(inStock.getId());
//        inStock.setStatus(status);
//        inStockService.save(inStock);
//    }
//    //更改出库单状态
//    @Transactional(readOnly = false)
//    public void updateOutStockStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String status=obj.get("status")+"";
//        OutStock outStock=outStockService.findUniqueByProperty("code",code);
//        outStock=outStockService.get(outStock.getId());
//        outStock.setStatus(status);
//        outStockService.save(outStock);
//        if(outStock.getType().equals("73")&&status.equals("5")){
//            InStock inStock=inStockService.findUniqueByProperty("order_id",outStock.getOrderId());
//            inStock=inStockService.get(inStock.getId());
//            inStock.setStatus("2");
//            inStockService.save(inStock);
//        }
//    }
//    //更改入库单前置单据状态
//    @Transactional(readOnly = false)
//    public void updateInStockBeforeStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        InStock inStock=inStockService.findUniqueByProperty("code",code);
//        inStock=inStockService.get(inStock.getId());
//        //采购入库
//    /*   if(inStock.getInStockType().equals("61")){
//           updatePurchaseStatus(params);
//       }
//        //退货入库
//       if(inStock.getInStockType().equals("62")){
//           updateReturnStatus(params);
//       }
//        //调拨入库
//       if(inStock.getInStockType().equals("63")){
//           updateRequisitionStatus(params);
//       }*/
//        inStockService.save(inStock);
//    }
////    //更改采购单明细表商品数量
////    //更改采购单明细表对应商品数量为原到货数量+本次入库数量
////    @Transactional(readOnly = false)
////    public void updatePurchaseSkuNumber(String code,String skuCode,String inStockAmount){
////        WmsPurchaseDetail wmsPurchaseDetail=new WmsPurchaseDetail();
////        wmsPurchaseDetail.setPurchaseCode(code);
////        wmsPurchaseDetail.setSkuCode(skuCode);
////        wmsPurchaseDetail=wmsPurchaseDetailService.findList(wmsPurchaseDetail).get(0);
////        wmsPurchaseDetail.setInstockAmount(wmsPurchaseDetail.getInstockAmount()+Integer.parseInt(inStockAmount));
////        wmsPurchaseDetailService.save(wmsPurchaseDetail);
////    }
//    //更改入库单明细表商品数量
//    //更改入库单明细表对应商品数量为原到货数量+本次入库数量
//    @Transactional(readOnly = false)
//    public void updateInStockSkuNumber(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String inStockAmount=obj.get("amount")+"";
//        InStockDetail instockDetail=new InStockDetail();
//        instockDetail.setInStockCode(code);
//       // instockDetail.setSkuCode(skuCode);
//        instockDetail=instockDetailMapper.findList(instockDetail).get(0);
//        instockDetail.setInStockAmount((instockDetail.getInStockAmount()==null? 0:instockDetail.getInStockAmount())+Integer.parseInt(inStockAmount));
//        instockDetailMapper.insert(instockDetail);
//    }
//    //更改出库单明细表商品数量
//    //更改出库单明细表对应商品数量为原到货数量+本次入库数量
//    @Transactional(readOnly = false)
//    public void updateOutStockSkuNumber(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String inStockAmount=obj.get("amount")+"";
//        OutStockDetail outstockDetail=new OutStockDetail();
//        outstockDetail.setOutStockCode(code);
//        outstockDetail.setSkuCode(skuCode);
//        outstockDetail=outStockDetailMapper.findList( outstockDetail).get(0);
//        outstockDetail.setOutStockAmount((outstockDetail.getOutStockAmount()==null? 0:outstockDetail.getOutStockAmount())+Integer.parseInt(inStockAmount));
//        outStockDetailMapper.insert(outstockDetail);
//    }
//
//
//    //新建保存出入库流水表，入库时
//    @Transactional(readOnly = false)
//    public void addInStockRecord(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String type=obj.get("type")+"";
//        String locationCode=obj.get("locationCode")+"";
//        String amount=obj.get("amount")+"";
//        String batch=obj.get("batch")+"";
//        String validDate=obj.get("validDate")+"";
//        String operator=obj.get("user")+"";
//        if(operator==null){
//            operator= UserUtils.getUser().getId();
//        }
//
//        InStock inStock=inStockService.findUniqueByProperty("code",code);
//        inStock=inStockService.get(inStock.getId());
//        Location location=new Location();
//
//        InOutRecord record=new InOutRecord();
//       // String inOutStatus=inStock.getInStockType();
//        InStockDetail instockDetail=new InStockDetail();
//        instockDetail.setInStockCode(code);
//       // instockDetail.setSkuCode(skuCode);
//        instockDetail=instockDetailMapper.findList(instockDetail).get(0);
//
//        //如果传上来的类型是移动货位增加
//        if(type.equals("inStockTempAdd")){
//         //货架放置在移动货架上
//          // location.setStoreId(inStock.getStoreId());
//            location.setName("暂存区");
//            location=locationService.findList(location).get(0);
//            record.setInOutType(1);
//            record.setSign(1);
//            //库内上架
//            record.setInOutStatus("60");
//        }
//        //如果传上来的类型是移动货位减少
//        if(type.equals("inStockTempReduce")){
//            //货架放置在移动货架上
//           // location.setStoreId(inStock.getStoreId());
//
//           location.setName("暂存区");
//            location=locationService.findList(location).get(0);
//            record.setInOutType(-1);
//            record.setSign(1);
//            //库内下架
//            record.setInOutStatus("70");
//        }
//        //如果传上来的类型是实际货位增加
//        if(type.equals("upStockAdd")){
//            location=locationService.findUniqueByProperty("locationcode",locationCode);
//            record.setInOutType(1);
//            record.setSign(1);
//            //真实入库类型
//           // record.setInOutStatus(inOutStatus);
//        }
//
//        record.setInOutId(inStock.getId());
//        record.setInOutCode(code);
//       // record.setStoreId(inStock.getStoreId().getId());
//        record.setLocationId(location.getId());
//        record.setLocationCode(location.getCode());
//       // record.setSkuId(instockDetail.getSkuId().getId());
//        record.setSkuCode(skuCode);
//       // record.setSkuName(instockDetail.getSkuName());
//        record.setSpec(instockDetail.getSpec());
//        record.setBatch(batch);
//        record.setValodDate(validDate);
//        record.setAmount(Double.parseDouble(amount));
//        record.setOperator(operator);
//        record.setOperateDate(new Date());
//        record.setStatus("1");
//        inOutRecordService.save(record);
//    }
//    //新建保存出入库流水表，出库时
//    @Transactional(readOnly = false)
//    public void addOutStockRecord(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String locationCode=obj.get("locationCode")+"";
//        String amount=obj.get("amount")+"";
//        String operator=obj.get("user")+"";
//        String inOutType=obj.get("inOutType")+"";
//        String batch=obj.get("batch")+"";
//        String validDate=obj.get("validDate")+"";
//        if(operator==null){
//            operator= UserUtils.getUser().getId();
//        }
//        Location location=locationService.findUniqueByProperty("code",locationCode);
//        OutStock outStock=outStockService.findUniqueByProperty("code",code);
//        outStock=outStockService.get(outStock.getId());
//        String inOutStatus=outStock.getType();
//        OutStockDetail outstockDetail=new OutStockDetail();
//        outstockDetail.setOutStockCode(code);
//        outstockDetail.setSkuCode(skuCode);
//        outstockDetail=outStockDetailMapper.findList(outstockDetail).get(0);
//        outstockDetail=outStockDetailMapper.get(outstockDetail.getId());
//        InOutRecord record=new InOutRecord();
//        record.setInOutType(-1);
//        record.setSign(1);
//        record.setBatch(batch);
//        record.setValodDate(validDate);
//        record.setInOutStatus(inOutStatus);
//        record.setInOutId(outStock.getId());
//        record.setInOutCode(code);
//        record.setStoreId(outStock.getStoreID().getId());
//        record.setLocationId(location.getId());
//        record.setLocationCode(locationCode);
//        record.setSkuId(outstockDetail.getSkuID().getId());
//        record.setSkuCode(skuCode);
//        record.setSkuName(outstockDetail.getSkuName());
//        record.setSpec(outstockDetail.getSpec());
//        record.setUnit(outstockDetail.getUnitPrice());
//        record.setAmount(Double.parseDouble(amount));
//        record.setOperator(operator);
//        record.setOperateDate(new Date());
//        record.setStatus("1");
//        inOutRecordService.save(record);
//    }
//    //更新库存表(新建或修改库存)
//    @Transactional(readOnly = false)
//    public void addOrUpdateStock(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String type=obj.get("type")+"";
//        String locationCode=obj.get("Code")+"";
//        String amount=obj.get("amount")+"";
//        String inorout=obj.get("inOutType")+"";
//        if(inorout.equals("2")){
//            OutStock outStock=outStockService.findUniqueByProperty("code",code);
//            outStock=outStockService.get(outStock.getId());
//            Stock stock=new Stock();
//            stock.setLocationCode(locationCode);
//            stock.setStoreId(outStock.getStoreID().getId());
//            stock=stockService.findList(stock).get(0);
//            stock.setQuantity(stock.getQuantity()-Integer.parseInt(amount));
//            stockService.save(stock);
//        }else{
//            InStock inStock=inStockService.findUniqueByProperty("code",code);
//             inStock=inStockService.get(inStock.getId());
//            Location location=new Location();
//            //如果传上来的类型是移动货位减少
//            //那么是原库存数量-入库商品数
//            if(type.equals("inStockTempReduce")){
//                //货架放置在移动货架上
//               // location.setStoreId(inStock.getStoreId());
//                location.setName("暂存区");
//                location=locationService.findList(location).get(0);
//                Sku sku = skuService.findUniqueByProperty("code", skuCode);
//                List<Stock> stockList = stockService.findStock(location.getStoreId().getId(), location.getId(), sku.getId());
//
//                //数据库中该货位必须有此商品库存,库存数量=原数量-本次上架数量
//                if (stockList.size() == 1) {
//                    Stock stock = stockList.get(0);
//                    stock.setQuantity(stock.getQuantity()-Double.parseDouble(amount));
//                    stockService.save(stock);
//                }
//        }
//
//        //否则是原库存数量-入库商品数
//        else {
//            //如果传上来的类型是移动货位增加
//            if (type.equals("inStockTempAdd")) {
//                //货架放置在移动货架上
//               // location.setStoreId(inStock.getStoreId());
//                location.setName("暂存区");
//                 location = locationService.findList(location).get(0);
//            }
//
//            //如果传上来的类型是实际货位增加
//            if (type.equals("upStockAdd")) {
//                location = locationService.findUniqueByProperty("code", locationCode);
//                location = locationService.get(location.getId());
//            }
//
//            Sku sku = skuService.findUniqueByProperty("code", skuCode);
//            List<Stock> stockList = stockService.findStock(location.getStoreId().getId(), location.getId(), sku.getId());
//            //如果数据库中该货位没有此商品库存
//            if (stockList.size() == 0) {
//                Stock stock = new Stock();
//                stock.setStoreId(location.getStoreId().getId());
//                stock.setLocationId(location.getId());
//                stock.setLocationCode(location.getCode());
//                stock.setQuantity(Double.parseDouble(amount));
//                stockService.save(stock);
//            }
//            //如果数据库中该货位有此商品库存,库存数量=原数量+本次上架数量
//            if (stockList.size() == 1) {
//                Stock stock = stockList.get(0);
//                stock.setQuantity(Double.parseDouble(amount) + stock.getQuantity());
//                stockService.save(stock);
//            }
//        }
//    }}
//    //新建保存出入库流水表，入库时(百仓网)
//    @Transactional(readOnly = false)
//    public void addInStockRecordBC(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String type=obj.get("type")+"";
//        String locationCode=obj.get("locationCode")+"";
//        String amount=obj.get("amount")+"";
//        String batch=obj.get("batch")+"";
//        String validDate=obj.get("validDate")+"";
//        String operator=obj.get("user")+"";
//        if(operator==null){
//            operator= UserUtils.getUser().getId();
//        }
//
//        InStock inStock=inStockService.findUniqueByProperty("code",code);
//        inStock=inStockService.get(inStock.getId());
//        Location location=new Location();
//
//        InOutRecord record=new InOutRecord();
//        //采购入库
//        String inOutStatus="61";
//        InStockDetail instockDetail=new InStockDetail();
//        instockDetail.setInStockCode(code);
//       // instockDetail.setSkuCode(skuCode);
//        instockDetail=instockDetailMapper.findList(instockDetail).get(0);
//
//        //如果传上来的类型是实际货位增加
//        if(type.equals("upStockAdd")){
//            location=locationService.findUniqueByProperty("locationcode",locationCode);
//            record.setInOutType(1);
//            record.setSign(1);
//            //真实入库类型
//            record.setInOutStatus(inOutStatus);
//        }
//
//        record.setInOutId(inStock.getId());
//        record.setInOutCode(code);
//        //长沙仓
//        record.setStoreId("ba5141c548c04292b34cc9e4329ebd14");
//        record.setLocationId(location.getId());
//        record.setLocationCode(location.getCode());
//       // record.setSkuId(instockDetail.getSkuId().getId());
//        record.setSkuCode(skuCode);
//       // record.setSkuName(instockDetail.getSkuName());
//        record.setSpec(instockDetail.getSpec());
//        record.setBatch(batch);
//        record.setValodDate(validDate);
//        record.setOperator(operator);
//        record.setOperateDate(new Date());
//        record.setStatus("1");
//        inOutRecordService.save(record);
//    }
//    //更新库存表(新建或修改库存) 百仓网 上架时增加库存
//    @Transactional(readOnly = false)
//    public void addOrUpdateStockBC(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String skuCode=obj.get("skuCode")+"";
//        String type=obj.get("type")+"";
//        String locationCode=obj.get("locationCode")+"";
//        String amount=obj.get("amount")+"";
//        String inorout=obj.get("inOutType")+"";
//        if(inorout.equals("2")){
//            OutStock outStock=outStockService.findUniqueByProperty("code",code);
//            outStock=outStockService.get(outStock.getId());
//            Stock stock=new Stock();
//            stock.setLocationCode(locationCode);
//            stock.setStoreId("ba5141c548c04292b34cc9e4329ebd14");
//            stock=stockService.findList(stock).get(0);
//            stock.setQuantity(stock.getQuantity()-Integer.parseInt(amount));
//            stockService.save(stock);
//        }else{
//            //如果传上来的类型是实际货位增加
//          //  if (type.equals("upStockAdd"))
//            InStock inStock=inStockService.findUniqueByProperty("code",code);
//            inStock=inStockService.get(inStock.getId());
//            Location location=new Location();
//
//            location = locationService.findUniqueByProperty("code", locationCode);
//            location = locationService.get(location.getId());
//
//            Sku sku = skuService.findUniqueByProperty("code", skuCode);
//            List<Stock> stockList =stockService.findStock(location.getStoreId().getId(), location.getId(), sku.getId());
//            //如果数据库中该货位没有此商品库存
//            if (stockList.size() == 0) {
//                Stock stock = new Stock();
//                stock.setStoreId(location.getStoreId().getId());
//                stock.setLocationId(location.getId());
//                stock.setLocationCode(location.getCode());
//                stock.setQuantity(Double.parseDouble(amount));
//                stockService.save(stock);
//            }
//            //如果数据库中该货位有此商品库存,库存数量=原数量+本次上架数量
//            if (stockList.size() == 1) {
//                Stock stock = stockList.get(0);
//                stock.setQuantity(Double.parseDouble(amount) + stock.getQuantity());
//                stockService.save(stock);
//            }
//        }}
//    /**
//     * 增加路由信息
//     * @param params
//     */
//    public void  addRouting(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String user=obj.get("user")+"";
//        String action=obj.get("action")+"";
//        String weight=obj.get("weight")+"";
//        String operation_website=userDao.get(user).getCompany().getName()+"-"+userDao.get(user).getOffice().getName();
//        String operation=actionScheduleService.get(action).getName();
//        String operator=userDao.get(user).getName();
//        String id= UUID.randomUUID()+"".replace("-","");
//        String sql="insert into tms_operation_track  values ('"+id+"','"+user+"',now(),'',null,0,now(),'"+operation_website+"','"+operation+"','','','"+code+"','"+operator+"','','','',null,'','','"+weight+"','')";
//        jdbc.execute(sql);
//
//
//    }
//
//    public void  updateOrderStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String user=obj.get("user")+"";
//        String action=obj.get("action")+"";
//        String status=obj.get("status")+"";
//        List<Map<String,Object>> list=jdbc.queryForList("select * from tms_bale_detail where bale_number='"+code+"'");
//        for(Map<String,Object> m:list){
//          String order_number=m.get("voucher_number")+"";
//          jdbc.execute("update tms_order set status="+status+" where code='"+order_number+"'");
//            String operation_website=userDao.get(user).getCompany().getName()+"-"+userDao.get(user).getOffice().getName();
//            String operation=actionScheduleService.get(action).getName();
//            String operator=userDao.get(user).getName();
//            String id= UUID.randomUUID()+"".replace("-","");
//            String sql="insert into tms_operation_track  values ('"+id+"','"+user+"',now(),'',null,0,now(),'"+operation_website+"','"+operation+"','','','"+order_number+"','"+operator+"','','','',null,'','','','')";
//            jdbc.execute(sql);
//
//        }
//
//    }
//
//    public void  updateStatus(String params){
//        JSONObject obj= JSONObject.parseObject(params);
//        String code=obj.get("code")+"";
//        String user=obj.get("user")+"";
//        String action=obj.get("action")+"";
//        String status=obj.get("status")+"";
//        String up=obj.get("update")+"";
//        Dispatch dispatch=dispatchService.findUniqueByProperty("code",code);
//        DispatchDetail datail=new DispatchDetail();
//        datail.setTmsDispatch(dispatch.getId());
//        List<DispatchDetail> list=detailMapper.findList(datail);
//        String operation_website=userDao.get(user).getCompany().getName()+"-"+userDao.get(user).getOffice().getName();
//        String operation=actionScheduleService.get(action).getName();
//        String operator=userDao.get(user).getName();
//        for(DispatchDetail m:list){
//            String order_number=orderService.get(m.getTmsOrder()).getCode();
//            if(up!=null&&!"null".equals(up)){
//                Date date=new Date();
//                jdbc.execute("update tms_order set status="+status+",receipt_date=now() where code='"+order_number+"'");
//            }else{
//            jdbc.execute("update tms_order set status="+status+" where code='"+order_number+"'");
//        }}
//        String id= UUID.randomUUID()+"".replace("-","");
//        String sql="insert into tms_operation_track  values ('"+id+"','"+user+"',now(),'',null,0,now(),'"+operation_website+"','"+operation+"','','','"+code+"','"+operator+"','','','',null,'','','','')";
//        jdbc.execute(sql);
//    }
//
//
//}